home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Experimental BBS Explossion 3
/
Experimental BBS Explossion III.iso
/
c
/
cp1.zip
/
EDSTRWIN.C2
< prev
next >
Wrap
Text File
|
1993-05-18
|
3KB
|
72 lines
===========================================================================
BBS: The Abacus * HST/DS * Potterville, MI
Date: 05-15-93 (13:55) Number: 161
From: GAINES WRIGHT Refer#: NONE
To: ZACH HANNA Recvd: NO
Subj: edsrtwin() 2 of 3 Conf: (36) C Language
---------------------------------------------------------------------------
//continued from last message
while(1)
{
str_len=strlen(string);
_setcursortype(_NOCURSOR);
gotoxy(xpos-1,ypos);
if(strpos>winlen-1)
{
strncpy(temp,&string[strpos-winlen+1],winlen);
putch(17);
}
else
{
strncpy(temp,string,winlen);
putch(32);
}
gotoxy(xpos+winlen,ypos);
if(str_len>winlen && strpos<str_len-1)
putch(16);
else
putch(32);
temp[winlen]='\0';
gotoxy(xpos,ypos);
cputs(temp);
if(str_len<=winlen)
putch(32);
if(strpos==str_len)
putch(32);
if(strpos>winlen-1)
gotoxy(xpos+winlen-1,ypos);
else
gotoxy(strpos+xpos,ypos);
if(insert)_setcursortype(_NORMALCURSOR);
else _setcursortype(_SOLIDCURSOR);
switch(c=getkey())
{
case 8: //backspace key
{
if(strpos<=0) break; //Don't go past beginning of string
strpos--; //No break!! Fall through to delete key
} //Since backspace = left arrow + delete
case -83: //delete key
{
if(strpos>=str_len) break; //Don't delete the '\0'
//Shift portion of string from cursor left one char
memmove(&string[strpos],&string[strpos+1],str_len-strpos);
break;
}
case 13: {free(temp); return(0);} //return key
case 27: {free(temp);return(-1);} //ESC exits
case -71: {strpos=0;break;} //home key
case -75: if(strpos>0) strpos--;break; //left key
case -77: if(strpos<str_len) strpos++;break; //right key
case -79: {strpos=str_len;break;} //end key
case -82: {insert=!insert;break;} //insert key
//continued next message
---
■ SLMR 2.1a ■ Back Up My Hard Drive? I Can't Find The Reverse Switch!
--- DCI/Chauncy 0.7b
* Origin: Bird Lake - (813)265-3256 (1:377/14.0)
SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20